package cn.ither.service.impl;

import cn.ither.service.TicketService;
import cn.ither.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

/**
 * @Author: zhanghuan
 * @date: 2020/11/19 15:35
 * @description:
 */
@Slf4j
@Service
public class UserServiceImpl implements UserService {

    //想拿到provider-server提供的票，要去注册中心拿到服务
    @Reference//引用 pom坐标，可以帝国一路径相同的接口名
    private TicketService ticketService;

    public String buyTicket() {
        String ticket = ticketService.getTicket();
        log.info("在注册中心拿到票");
        return ticket;
    }

}
